from django.contrib import admin
from django.contrib.auth.models import Permission

from .models import Person, PersonDetail

# Register your models here.
admin.site.register(Permission)


class PersonDetailInline(admin.TabularInline):
    model = PersonDetail
    extra = 1


class PersonAdmin(admin.ModelAdmin):  # 确保这里的类名和你的模型匹配
    inlines = [PersonDetailInline]
    list_display = ('id', 'username', 'is_superuser', 'is_active', 'is_staff', 'date_joined', 'last_login')
    list_filter = ('username',)


admin.site.register(Person, PersonAdmin)
admin.site.register(PersonDetail)
